PROCEDURE GetColor (in: Ports.Color; VAR out: Ports.Color; VAR set: BOOLEAN);
PROCEDURE DayOfWeek (VAR t: Time): INTEGER;
PROCEDURE Call (proc, errorMsg: ARRAY OF CHAR; VAR res: LONGINT);
PROCEDURE Beep;
PROCEDURE Disable;
PROCEDURE Call (proc: ARRAY OF CHAR; VAR res: LONGINT);
END Dialog.
Module Dialog provides a variety of auxiliary services to simplify user interaction of a program. In particular, the output of messages, e.g. error messages, is supported. Furthermore, various base types are provided: Field, Enumeration, Subrange, etc. These types are known to the framework and can be displayed by suitable controls, i.e. views which display not a normal model, but instead a variable of one of the mentioned types. Some of these types can be extended, e.g. enumerations can be extended to define a particular concrete enumeration type, which then can be displayed e.g. as a pop-up menu.
TYPE String
String type for various names to be displayed for the user, or to be entered by the user.
TYPE Interactor
Interface
This is the base type of interactors, i.e. of global record variables which can be represented as dialog boxes or property sheets.
PROCEDURE (VAR i: Interactor) Notify
This procedure should be called after one or several fields of the interactor have been modified. It causes a broadcast of a Views.NotifyMsg with ~msg.checkGuards.
PROCEDURE (VAR i: Interactor) CheckGuards
This procedure should be called after one or several fields of the interactor have been modified such that enabled controls on this interactor may have become disabled, or vice versa. It causes a broadcast of a Views.NotifyMsg with msg.checkGuards.
TYPE Field
Interface
Base type of various types which can be displayed and edited interactively.
This procedure must be extended to check whether the field's current value is legal. If not, a non-empty error message err should be returned, otherwise err should be set to "". err may contain up to three place-holders in the form "^0", "^1", and "^2". These place-holders will be substituted by the parameter strings p0, p1, and p2, respectively. All four strings are mapped before they are used (cf. MapParamString below).
TYPE Array
Interface, Extension
Base type of all array fields.
len: LONGINT len >= 0
Indicates the number of array elements currently valid, i.e. elements [0..len).
TYPE Enumeration
Interface, Extension
Base type of all enumeration types. An enumeration type defines a subset of the LONGINT type, and a name (string) for each element of this subset. All valid names can be enumerated by indexing from 0 upwards, and stopping when the empty string is returned.
val: LONGINT
Current value of the enumeration.
PROCEDURE (VAR e: Enumeration) GetName (i: LONGINT; VAR name: String)
Interface
Given an index i, the corresponding name is returned. If i is outside of the valid index range, the emtpy string "" is returned.
i >= 0 20
name # "" iff index i is valid
PROCEDURE (VAR e: Enumeration) GetValue (i: LONGINT; VAR val: LONGINT)
Interface
Given a valid index i, the corresponding value is returned.
index i is valid 20
TYPE Selection
Interface, Extension
A selection is similar to an enumeration, except that not exactly one value can be represented, but between 0 and 32 values instead, i.e. a selection is a set of enumerations.
val: SET
Current value of the selection.
mask: SET
Currently valid elements of the selection.
PROCEDURE (VAR s: Selection) GetName (i: LONGINT; VAR name: String)
Interface
Given an index i, the corresponding name is returned. If i is outside of the valid index range, the emtpy string "" is returned.
i >= 0 20
name # "" iff index i is valid
PROCEDURE (VAR s: Selection) GetValue (i: LONGINT; VAR val: LONGINT)
Interface
Given a valid index i, the corresponding value is returned.
index i is valid 20
TYPE Time
Time information.
year: INTEGER 1583 <= year <= 9999
month: INTEGER 1 <= month <= 12
day: INTEGER 1 <= day <= 31
hour: INTEGER 1 <= hour <= 24
minute: INTEGER 1 <= minute <= 60
second: INTEGER 1 <= second <= 60
TYPE Subrange
Extension
Subranges denote values which are restricted to lie in a subrange of INTEGER.
val: INTEGER min <= val <= max
Current value.
min, max: INTEGER min <= max
Subrange bounds.
TYPE Color
Extension
Color enumeration.
TYPE Size
Extension
Enumeration for font sizes given in points (Fonts.point).
TYPE Style
Extension
Selection type for font styles. Valid elements are {Fonts.italic..Fonts.strikeout}.
TYPE Weight
Extension
Field type for font weights. Values range from 1 to 1000.
TYPE Length
Extension
Enumeration type for unsigned document units. Values range from Views.undefined to Views.infinite.
TYPE Units
Extension
Enumeration type for signed document units. Values range from -Views.infinite to +Views.infinite.
TYPE Par
Values of this parameter type are used to set up the names of menu items, and to disable or check menu items. The global variable par of this type is predefined.
disabled: BOOLEAN
Initially set to FALSE, this field can be set to TRUE by guard commands, to disable a menu item or a control.
checked: BOOLEAN
Initially set to FALSE, this field can be set to TRUE to show a check mark for a menu item.
string: String
For menu items which show different strings depending on the current context, the current string can be deposited here.
VAR background: Ports.Color background >= 0
The background color of dialogs.
VAR metricSystem: BOOLEAN
This variable indicates whether sizes should be measured in metric units or in inches.
VAR maxBorderSize: LONGINT maxBorderSize > 0 [units]
This variable indicates how much space around a focussed or selected view may be occupied by its container's marks.
VAR par: Par
Standard parameter for menu and control disabling. This pointer must not be NIL during the execution of a menu guard or a control guard.
VAR showStatus: BOOLEAN
Indicates whether status messages are currently possible.
VAR version: INTEGER
Indicates the current version of Oberon/F.
100 = version 1.0
VAR platform: INTEGER
Indicates on which host operating system the application is running.
11 = Windows 3.1
12 = Windows95
13 = Windows/NT 3.x
21 = Mac OS 7.x
VAR appName: ARRAY 32 OF CHAR
Gives the name of the application program which is currently running; the default is "Oberon/F".
PROCEDURE GetTime (VAR t: Time)
Get the current time.
PROCEDURE MapParamString (in, p0, p1, p2: ARRAY OF CHAR;
VAR out: ARRAY OF CHAR)
Translates string in into string out. Strings of the form "#Subsystem:message" are translated if there is a corresponding "strings" resource file for this subsystem (in the subsystem's "Rsrc" directory). Otherwise, the "#Subsystem:" prefix is stripped away, if there is no resource file.
As an example, "#System:Cancel" may be translated to "Cancel" in the USA, and to "Abbrechen" in Germany; or to "Cancel" if the resource file or the appropriate entry is missing.
Three additional input parameters can be spliced into the in parameter. These parameters are inserted where "^0", "^1", or "^2" occur in in. The parameters are mapped individually as well.
MapParamString allows to remove country- and language-specific strings from a program source text, while at the same time providing a default string in the program source text such that the program always works, even if string resources are missing.
PROCEDURE MapString (in: ARRAY OF CHAR; VAR out: ARRAY OF CHAR)
This is a simplified version of MapParamString which has no additional input parameters.
Except for performance, equivalent to:
MapParamString(in, "", "", "", out)
PROCEDURE ShowParamMsg (str, p0, p1, p2: ARRAY OF CHAR)
Presents str as a message to the user. The string is mapped, as are the additional input parameters p0, p1, and p2.
PROCEDURE ShowMsg PROCEDURE (str: ARRAY OF CHAR)
This is a simplified version of ShowParamMsg which has no additional input parameters.
Except for performance, equivalent to:
ShowParamMsg(str, "", "", "")
PROCEDURE ShowParamStatus (str, p0, p1, p2: ARRAY OF CHAR)
Presents str as a message to the user. The string is mapped, as are the additional input parameters p0, p1, and p2. In contrast to ShowParamMsg, ShowParamStatus is used for shorter-living messages, e.g. messages produced and updated during a lengthy process.
PROCEDURE ShowStatus PROCEDURE (str: ARRAY OF CHAR)
This is a simplified version of ShowParamStatus which has no additional input parameters.
Except for performance, equivalent to:
ShowParamStatus(str, "", "", "")
PROCEDURE GetOK (str, p0, p1, p2: ARRAY OF CHAR; VAR ok: BOOLEAN)
Modal dialog
Presents a mapped string, with the optional parameters p0 to p2, in a modal dialog box. The user has the choices to say "yes" (ok) or "no". The result is returned in ok.
PROCEDURE GetIntSpec (type: Files.Type; VAR stationary: BOOLEAN;
VAR loc: Files.Locator; VAR name: Files.Name)
Modal dialog
Ask the user for a file specification (loc, name). type indicates which file type is desired ("" stands for Oberon documents, "*" is a wildcard for all file types; other types are platform-specific, e.g. "TXT" for Windows Ascii files or "TEXT" for Macintosh Ascii files). loc # NIL indicates a valid file specification. stationary indicates whether the specified file is a stationary, i.e. a template which should be copied before a modification.
Ask the user for a file specification for externalizing a file.
PROCEDURE GetColor (in: Ports.Color; VAR out: Ports.Color; VAR set: BOOLEAN)
Modal dialog
Ask the user for a color.
PROCEDURE DayOfWeek (VAR t: Time): INTEGER
Return the weekday of time t, with encoding Monday = 0, Tuesday = 1, ... Sunday = 6;
(DayOfWeek + 1) MOD 7 + 1 transforms to the American convention Sunday = 1, Monday = 2, ... Saturday = 7.
1583 <= year <= 9999 (not explicitly checked)
PROCEDURE Beep
Emit a short beep sound.
PROCEDURE Disable
Disables the menu/control filter par.
Except for performance equivalent to:
IF par # NIL THEN par.disabled := TRUE END
PROCEDURE Call (cmd, errorMsg: ARRAY OF CHAR; VAR res: LONGINT)
Call executes a sequence of Oberon commands (i.e. a parameterless exported procedures) denoted by cmd. If the corresponding modules are not yet loaded, Call tries to load them. If some error occurrs, command execution terminates and res is returned with a value # 0. If errorMsg = "", Call does not display error messages. If errorMsg # "", Call displays errorMsg in case of an error, appended with a short description of the particular error having occurred.